home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / ng-english.g < prev    next >
Text File  |  1995-05-04  |  2KB  |  84 lines

  1. ;;; Ye Olde English name generator.
  2.  
  3. ;;; It usually composes from a set of stock syllables that occur a lot (just
  4. ;;; look at an atlas), with the occasional totally random syllable thrown in.
  5. ;;; Sometimes the syllables are *too* random or else in an inappropriate
  6. ;;; context, but fixing that would require some context-sensitivity in the
  7. ;;; grammar.
  8.  
  9. (game-module "english"
  10.   (blurb "Random English place name synthesizer")
  11. )
  12.  
  13. ;;; just a test that other namers can be nonterminals
  14. (namer english-metro-names (grammar root 9
  15.   (root (or 50 ("city of " english-place-names)
  16.         50 ("Metropolitan " english-place-names)))
  17. ))
  18.  
  19. (namer english-place-names (grammar root 9
  20.   (root (or 90 (word)
  21.         10 (prefix-word word)
  22.          5 (word connective word)
  23.     ))
  24.   (word (or 60 (prefix suffix)
  25.         15 (prefix both)
  26.         40 (syllable suffix)
  27.         15 (both suffix)
  28. ;        5 (both "ing" suffix)
  29.     ))
  30.   (prefix (or
  31.     2 south 2 north 2 east 2 west
  32.     ;; probably not any yellow,orange,purple towns in England
  33.     3 black blue 2 green red brown gray 3 white
  34.     peter whit wash ; what else?
  35.     ))
  36.   (prefix-word (or "lower " "upper " "new " "old " "great " "little "))
  37.   ;;; s sometimes inserted randomly
  38.   (suffix (or
  39.     borough bury
  40.     cester chester
  41.     field ford
  42.     gate
  43.     hall ham hill house
  44.     ing ington ingston
  45.     land lea ley ly
  46.     minster mouth
  47.     ney
  48.     port
  49.     sea sey stable stead stone ; "sy" doesn't fit well, where to do it?
  50.     toke ton
  51.     well wich worth
  52.     ))
  53.   (both (or
  54.     brook field kirk water
  55.     ))
  56.   (connective (or 2 "-upon-" 4 "-on-" "-in-" "-over-" "-under-"))
  57.  
  58.   (syllable (or (start vowel) (vowel end) 3 (start vowel end)))
  59.   (start (or 3 initdiph 7 startcons))
  60.   (end (or 4 enddiph 4 endcons))
  61.   (vowel (or 5 a 9 e 2 i 3 o 2 u y ey))
  62.   (startcons (or
  63.      2 b 2 c 3 d 2 f 2 g 3 h   j 2 k 3 l 3 m
  64.      6 n 3 p 4 r 5 s 9 t     2 w            ))
  65.   (endcons (or
  66.      3 d 2 g 3 l 3 m
  67.      6 n 4 r 5 s 9 t     2 w            ))
  68.   (initdiph (or 
  69.     bl cl    fl gl pl sl
  70.     br cr dr fr gr pr    3 tr wr 
  71.     3 ch 3 sh 3 th wh
  72.     2 sm 2 sp 4 st sw
  73.     ))
  74.   (enddiph (or
  75.     ld lf lk ll lm ln lp    ls lt
  76.     rd rf rk rl rm rn rp rs rt
  77.     mp
  78.     3 nd 2 ng nk 3 nt
  79. ;    gh  ; hard to say...
  80.     ))
  81. ))
  82.  
  83. ; cons vowel (or r l) vowel cons  - as in "Salis"
  84.